import os  
import sys  
import signal 

pid=os.popen("netstat -anp|grep 9999 |awk '{print $7}'").read().split('/')[0] 
if not pid:
  print("9999 port is not listen")
else:
  print(pid)
  try:
    kill_result=os.kill(pid,signal.SIGKILL)
  except OSErro:
    print("kill %s pid erro",pid)
  deploy();
def deploy():
  try:
    os.system("java -jar target/reception-1.0-SNAPSHOT.jar")
    print("deploy success!")
  except Error:
    print("deploy failure!")
